package com.zline.foodraise.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by heshantao on 15/7/29.
 * 动态
 */
public class MomentBean implements Parcelable{
    //此条动态的评论数
    int commentCount;
    //动态内容
    String content;
    //创建时间戳
    long createTimeStamp;
    //最近3条评论列表
    List<CommentBean> fnInCommentBeanList;
    //前六个赞的用户列表
    List<CustomerUserBean> fnInMomentPraiseList;
    //当前用户是否为此条动态点过赞,1代表赞过
    int isPraise;
    //动态ID
    long momentId;
    //点赞数量
    int momentPraiseCount;
    //图片列表
    List<PictureBean> pictureBeanList;
    //项目ID
    long projectId;
    //发布动态的用户
    CustomerUserBean userBean;
    //用户Id
    long userId;

    public MomentBean() {
    }

    public MomentBean(int commentCount, String content, long createTimeStamp,
                      List<CommentBean> fnInCommentBeanList, List<CustomerUserBean>
                              fnInMomentPraiseList, int isPraise, long momentId,
                      int momentPraiseCount, List<PictureBean> pictureBeanList,
                      long projectId, CustomerUserBean userBean, long userId) {
        this.commentCount = commentCount;
        this.content = content;
        this.createTimeStamp = createTimeStamp;
        this.fnInCommentBeanList = fnInCommentBeanList;
        this.fnInMomentPraiseList = fnInMomentPraiseList;
        this.isPraise = isPraise;
        this.momentId = momentId;
        this.momentPraiseCount = momentPraiseCount;
        this.pictureBeanList = pictureBeanList;
        this.projectId = projectId;
        this.userBean = userBean;
        this.userId = userId;
    }

    public int getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(int commentCount) {
        this.commentCount = commentCount;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public long getCreateTimeStamp() {
        return createTimeStamp;
    }

    public void setCreateTimeStamp(long createTimeStamp) {
        this.createTimeStamp = createTimeStamp;
    }

    public List<CommentBean> getFnInCommentBeanList() {
        return fnInCommentBeanList;
    }

    public void setFnInCommentBeanList(List<CommentBean> fnInCommentBeanList) {
        this.fnInCommentBeanList = fnInCommentBeanList;
    }

    public List<CustomerUserBean> getFnInMomentPraiseList() {
        return fnInMomentPraiseList;
    }

    public void setFnInMomentPraiseList(List<CustomerUserBean> fnInMomentPraiseList) {
        this.fnInMomentPraiseList = fnInMomentPraiseList;
    }

    public int getIsPraise() {
        return isPraise;
    }

    public void setIsPraise(int isPraise) {
        this.isPraise = isPraise;
    }

    public long getMomentId() {
        return momentId;
    }

    public void setMomentId(long momentId) {
        this.momentId = momentId;
    }

    public int getMomentPraiseCount() {
        return momentPraiseCount;
    }

    public void setMomentPraiseCount(int momentPraiseCount) {
        this.momentPraiseCount = momentPraiseCount;
    }

    public List<PictureBean> getPictureBeanList() {
        return pictureBeanList;
    }

    public void setPictureBeanList(List<PictureBean> pictureBeanList) {
        this.pictureBeanList = pictureBeanList;
    }

    public long getProjectId() {
        return projectId;
    }

    public void setProjectId(long projectId) {
        this.projectId = projectId;
    }

    public CustomerUserBean getUserBean() {
        return userBean;
    }

    public void setUserBean(CustomerUserBean userBean) {
        this.userBean = userBean;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(commentCount);
        dest.writeString(content);
        dest.writeLong(createTimeStamp);
        dest.writeList(fnInCommentBeanList);
        dest.writeList(fnInMomentPraiseList);
        dest.writeInt(isPraise);
        dest.writeLong(momentId);
        dest.writeInt(momentPraiseCount);
        dest.writeList(pictureBeanList);
        dest.writeLong(projectId);
        dest.writeParcelable(userBean,flags);
        dest.writeLong(userId);

    }

    public static final Creator<MomentBean> CREATOR = new Creator<MomentBean>() {
        public MomentBean createFromParcel(Parcel in) {
            return new MomentBean(in);
        }

        public MomentBean[] newArray(int size) {
            return new MomentBean[size];
        }
    };


    private MomentBean(Parcel in){
        commentCount=in.readInt();
        content = in.readString();
        createTimeStamp =in.readLong();
        fnInCommentBeanList = in.readArrayList(CommentBean.class.getClassLoader());
        fnInMomentPraiseList = in.readArrayList(CustomerUserBean.class.getClassLoader());
        isPraise = in.readInt();
        momentId = in.readLong();
        momentPraiseCount = in.readInt();
        pictureBeanList = in.readArrayList(PictureBean.class.getClassLoader());
        projectId = in.readLong();
        userBean = in.readParcelable(CustomerUserBean.class.getClassLoader());
        userId = in.readLong();
    }
}
